package cn.controller.order;

import cn.service.orderService.OrderServiceImpl.ReturnTypeServiceImpl;
import entity.Result;
import entity.orderEntity.ReturnType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 朱颢阳
 * @description
 * @time 2024/8/27 11:42
 */
@RestController
@CrossOrigin
@RequestMapping("/order")
public class ReturnTypeController {
    @Autowired
    ReturnTypeServiceImpl service;
    @RequestMapping("/getTypes")
    public Result getTypes(Integer currentPage,Integer pageSize){
        return service.getTypes(currentPage,pageSize);
    }
    @RequestMapping("/updateavailable")
    public Result updateavailable(Integer id,Integer available){
        return service.updateavailable(id,available);
    }
    @RequestMapping("/updataType")
    public Result updataType(@RequestBody ReturnType returnType){
        return service.updataType(returnType);
    }
    @RequestMapping("/insertType")
    public Result insertType(@RequestBody ReturnType returnType){
        return service.insertType(returnType);
    }
    @RequestMapping("/deleteType")
    public Result deleteType(Integer id){
        return service.deleteType(id);
    }
    @RequestMapping("/selectAllType")
    public Result selectAllType(){
        return service.getAllTypes();
    }
}
